<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<!-- 
		Replace path to template, title, header and body
		with actual data.
	 -->
<ui:composition template="/templates/common.xhtml">
	<ui:define name="pageTitle">Title</ui:define>
	<ui:define name="pageHeader">Header</ui:define>
	<ui:define name="body">
		<h:form id="frm">
			<p:outputPanel id="pnPrincipal">
				<p:growl id="grow" showDetail="true"></p:growl>
				<p:inputText value="#{loginHome.cliente.nome}"></p:inputText>
				<p:commandButton value="Salvar" actionListener="#{loginHome.salvar}"
					update="frm"></p:commandButton>
				<p:commandButton value="Limpar" actionListener="#{loginHome.limpar}"
					update="frm"></p:commandButton>
				<p:spacer height="10px"></p:spacer>
	
				<p:dataTable value="#{loginHome.listaClientes}" var="cliente">

					<p:column headerText="Cód.">
						<h:outputText value="#{cliente.id}" />
					</p:column>
					<p:column headerText="Nome">
						<h:outputText value="#{cliente.nome}" />
					</p:column>
					<p:column>
						<p:commandButton id="selectButton" update=":frm" action="#{loginHome.excluir}" 
							icon="ui-icon-delete" title="View">
							<f:setPropertyActionListener value="#{cliente}"
								target="#{loginHome.cliente}" />
						</p:commandButton>

					</p:column>

				</p:dataTable>
			</p:outputPanel>
		</h:form>
	</ui:define>
</ui:composition>

</html>